package com.xs.jmb2c.controller;

import com.xs.jmb2c.common.Result;
import com.xs.jmb2c.dto.AdminLoginDTO;
import com.xs.jmb2c.service.AdminService;
import com.xs.jmb2c.vo.AdminLoginVO;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 管理员用户表 前端控制器
 * </p>
 *
 * @author wuyunbin
 * @since 2025-07-07
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Resource
    private AdminService adminService;

    @Operation(summary = "管理员登录接口", description = "管理员登录接口")
    @PostMapping("login")
    public Result<AdminLoginVO> login(@RequestBody AdminLoginDTO adminLoginDTO) {
        //todo 需要在service层实现具体逻辑
        AdminLoginVO adminLoginVO = adminService.login(adminLoginDTO);
        return Result.success(adminLoginVO);
    }
}
